#! /bin/sh

groupId="com.group"
version="version."
outputFile="dependencies.xml"

echo "<dependencies>" > $outputFile

counter=0

for file in *.jar
do
	artifactId=`echo $file | sed -e 's/.jar//g'`
	mvn deploy:deploy-file -Durl=http://vs-dev01-mjh01.rencap.dev:8081/nexus/content/repositories/calypso -DrepositoryId=nexusCalypso -Dfile=$file -DgroupId=$groupId -DartifactId=$artifactId -Dversion=$version -Dpackaging=jar -DgeneratePom=true
	echo "	<dependency>
            <groupId>$groupId</groupId>
            <artifactId>$artifactId</artifactId>
            <version>$version</version>
        </dependency>" >> $outputFile
    let "counter += 1"
done
echo "Total number of uploaded is $counter"
echo "</dependencies>" >> $outputFile

